package zx.tas.model


data class SkillV2(
    val name: String,
    val enable: Int,  // 0禁用. 1战斗. 2全程. 3仅Boss+精英. 4仅Boss
    val userCd: Long,  // 最大cd
    val userLongPressTs: Long, // 长按时间
    val releaseType: Int, // 好了就放. 随机延迟
) {
    // ${if (userCd > 0) "最大冷却${userCd / 1000f}秒" else ""}
    val infoText get() = if (enable == 0) "已禁用" else "${if (enable == 1) "仅战斗释放" else if (enable == 2) "全程释放" else if (enable == 3) "仅Boss和精英释放" else if (enable == 4) "仅Boss释放" else "" }${if (userLongPressTs > 0) "\n长按${userLongPressTs / 1000f}秒" else "" } ${if (releaseType == 1) "\n随机延时" else "\n好了就放"}  ${if (userCd in 1..59999) "\n最大冷却${userCd / 1000f}秒" else ""}"
    override fun toString(): String {
        val sb = StringBuilder()
        sb.append(name)
        sb.append(if (enable == 0) "[禁用]" else "[启用]")
        return sb.toString()
    }
}